package com.ykdl.member.kid.beans;

import java.io.Serializable;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import net.wxxr.http.interfaces.IJsonParser;

public class TicketBean implements Serializable ,IJsonParser{

	/**
	 * Ticket实体
	 * {
  "tickets": [
    {
      "status": 2,
      "pay_begin_time": [
        12,
        12
      ],
      "coupon_type": 1,
      "valid_note": "有效期声明",
      "pay_end_time": [
        12,
        12
      ],
      "valid_begin_time": 1430327111,
      "members_only": true,
      "coupon_id": 1,
      "note": "使用说明",
      "created_time": 1430131505.857201,
      "discount_text": "优惠方式说明",
      "valid_end_time": 1432799447,
      "scope": "适用范围",
      "coupon_num_2": 0,
      "logo": {
        "url": "http://imgs.ykdllmyr.com/coupon_logo/2015/4/27/HsDP8GeFwikk6tzpdw8RcJ.jpeg",
        "width": 690,
        "file_id": 100000939,
        "height": 488
      },
      "coupon_num_1": 100,
      "discount_to": "优惠对象",
      "store": {
        "store_id": 100100268,
        "name": "逗比的门店"
      }
    }
  ]
}
	 */
	private static final long serialVersionUID = -9069507298896676814L;
//	private List<String> pay_begin_time ;//优惠劵支付开始时间，2个元素列表组成，代表时分
//	private List<String> pay_end_time ;//优惠劵支付结束时间，2个元素列表组成，代表时分
	private int coupon_type;//优惠劵类型:1  # 抵用  2  # 满减  3  # 买赠  4  # 直降
	private String begin_time;// 优惠劵有效期开始时间
	private String end_time;// 优惠劵有效期结束时间
	private boolean members_only ;// 是否只有成为门店会员才可以领取，前端展现为vip图标
	private boolean member_flag ;//  用户是否是该门店的会员
	private boolean receive_flag ;//  该用户是否领过同样的优惠劵
	private boolean is_render_ticket_code ;//  是否生成券号 
	private String ticket_id ;//券号 
	private boolean used ;//  是否生成券号 
	private String valid_note;//是否使用
	private String coupon_id;
	private String note;//"使用说明
	private String created_time;
	private String discount_text;//优惠方式说明
	private String scope;//适用范围
	private String coupon_num_2;//优惠劵上显示的数字第二个，比如买三增一的“1”
	private String coupon_num_1;//优惠劵上显示的数字第二个，比如买三增一的“3”
	private String discount_to;//优惠对象
	private FileBean logo;
	private StoreBean store;
	
	public boolean isMember_flag() {
		return member_flag;
	}

//	public List<String> getPay_begin_time() {
//		return pay_begin_time;
//	}
//
//	public List<String> getPay_end_time() {
//		return pay_end_time;
//	}

	public int getCoupon_type() {
		return coupon_type;
	}

	public String getValid_begin_time() {
		return begin_time;
	}

	public String getValid_end_time() {
		return end_time;
	}

	public boolean isMembers_only() {
		return members_only;
	}

	public boolean isReceive_flag() {
		return receive_flag;
	}

	public boolean isIs_ticket_code() {
		return is_render_ticket_code;
	}

	public String getTicket_id() {
		return ticket_id;
	}

	public boolean isUsed() {
		return used;
	}

	public String getValid_note() {
		return valid_note;
	}

	public String getCoupon_id() {
		return coupon_id;
	}

	public String getNote() {
		return note;
	}

	public String getCreated_time() {
		return created_time;
	}

	public String getDiscount_text() {
		return discount_text;
	}

	public String getScope() {
		return scope;
	}

	public String getCoupon_num_2() {
		return coupon_num_2;
	}

	public String getCoupon_num_1() {
		return coupon_num_1;
	}

	public String getDiscount_to() {
		return discount_to;
	}

	public FileBean getLogo() {
		return logo;
	}

	public StoreBean getStore() {
		return store;
	}

	@Override
	public IJsonParser parse(String json) throws Exception {
		// TODO Auto-generated method stub
		Gson   gson = null;
		if(null != json){
			GsonBuilder b = new GsonBuilder();
			gson  = b.create();
			return gson.fromJson(json, TicketBean.class);
		}
		return null;
	}

}
